#include<stdio.h>
#include<string.h>
#include<stdlib.h>

char GNGGA[]="$GNGGA,104630.000,3512.4194,N,10514.7439,E,1,09,1.2,1820.2,M,-40.5,M,,0000*58";
double GNGGA_DATA[14];
int main()
{
	char *temp[14];
	char *ret,*tem;
	char arry[20]={0};
	char arry1[]="3512.4194";
	char arry2[]="3.1415926";
	int i=0;
	ret=strtok(GNGGA,",");	
	while((ret=strtok(NULL,","))!=NULL)
	{
		temp[i]=ret;
		printf("原始数据：%s\n",temp[i]);
			
		strcpy(arry,ret);
		GNGGA_DATA[i]=atof(arry);
		printf("转化数据：%lf\n",GNGGA_DATA[i]);

		i++;
	}
/*

	printf("---------测试---------\n");
	printf("截取字符串：%s\n",arry1);
	double sample=atof(arry1);
	printf("转化：%lf\n",sample);
	double sample1=atof(arry2);
	printf("转化：%lf\n",sample1);

*/	
	return 0;
}
